package com.iflysse.services;

import com.iflysse.pojo.bo.CommonBoResp;
import com.iflysse.pojo.bo.req.*;
import com.iflysse.pojo.bo.resp.*;

import java.sql.SQLException;
import java.util.List;

/**
 * 资源服务接口
 */
public interface ResourceService {
    /**
     * 添加html资源
     * @param addResourceBoReq  ,抽象类,
     *                          具体子类有:AddResourceHtmlBoReq,
     *                          AddResourceDocBoReq,
     *                          AddResourceVideoBoReq,
     *                          AddResourceQuestionBoReq
     * @return
     */
    CommonBoResp addResource(AddResourceBoReq addResourceBoReq) throws SQLException;

    /**
     * 根据章编号获取资源
     * @param chapterIdBoReq 章编号
     * @return
     */
    ResourceListBoResp loadResourceByChapterId(ChapterIdBoReq chapterIdBoReq) throws SQLException;

    /**
     * 根据资源编号获取html资源
     * @param resourceIdBoReq
     * @return
     */
    ResourceHtmlBoResp getHtmlResourceByResourceId(ResourceIdBoReq resourceIdBoReq) throws SQLException;

    /**
     * 根据资源编号获取文档和视频资源
     * @param resourceIdBoReq
     * @return
     */
    ResourceDocAndVideoBoResp getDocAndVideoResourceByResourceId(ResourceIdBoReq resourceIdBoReq) throws SQLException;


    /**
     * 根据资源编号获取测试资源
     * @param resourceIdBoReq
     * @return
     */
    ResourceTestBoResp getTestResourceByResourceId(ResourceIdBoReq resourceIdBoReq) throws SQLException;


    /**
     * 根据章编号获取资源列表(学生端学习界面,有学习记录数据)
     * @param chapterIdBoReq 章编号
     * @return
     */
    StudentLearnResourceListBoResp loadStudentLearnResourceByChapterId(StudentChapterIdBoReq chapterIdBoReq) throws SQLException;


    /**
     * 添加学生学习资源的学习记录
     * @param studentLearnRecordBoReq 学生学习记录请求实体,资源类型,资源编号,学生编号,任务编号,章节编号
     * @return
     */
    CommonBoResp addStudentLearnRecord(StudentLearnRecordBoReq studentLearnRecordBoReq) throws SQLException;





    /**
     * 根据关键字搜索资源
     * @param keywords 关键字
     * @param studentId 学生编号
     * @return
     */
    SearchResourceListBoResp getResourceByKeywords(String keywords,String studentId) throws SQLException;

    /**
     * 根据资源编号列表获取资源信息
     * @param resourceIds
     * @return
     * @throws SQLException
     */
    SearchResourceListBoResp getResourceByResourceIds(List<String> resourceIds) throws SQLException;


}
